pub use jsonrpsee::core::{async_trait, RpcResult};
use jsonrpsee::proc_macros::rpc;
use serde::{Deserialize, Serialize};

#[derive(Clone, Serialize, Deserialize)]
pub struct StatusReport {
    pub healthy: bool,
}

#[rpc(server, namespace = "asphs")]
pub trait HomeserverRpc {
    #[method(name = "status")]
    async fn status(&self) -> RpcResult<StatusReport>;

    #[method(name = "stop")]
    async fn stop(&self) -> RpcResult<()>;

    #[method(name = "queue_server_msg")]
    async fn queue_server_msg(&self, msg: String) -> RpcResult<u64>;
}
